package bb.lanxing.lib.devices.bici.model;

import com.github.mikephil.charting.utils.Utils;
import java.io.Serializable;
import java.math.BigDecimal;

public class CyclingData implements Serializable {
    public static final int MIN_MM = 60000;
    public static final double WHEEL_LENGTH = 1.6d;
    private int crank;
    private int cumulativecrank;
    private int cumulativewheel;
    private double distance;
    private int duration;
    private int power;
    private double wheel;

    public int getCumulativecrank() {
        return this.cumulativecrank;
    }

    public void setCumulativecrank(int i) {
        this.cumulativecrank = i;
    }

    public int getCumulativewheel() {
        return this.cumulativewheel;
    }

    public void setCumulativewheel(int i) {
        this.cumulativewheel = i;
    }

    public int getCrank() {
        return this.crank;
    }

    public void setCrank(int i) {
        if (i != 0) {
            this.crank = 60000 / i;
        } else {
            this.crank = 0;
        }
    }

    public double getWheel() {
        return this.wheel;
    }

    public void setWheel(int i) {
        if (i != 0) {
            this.wheel = new BigDecimal((1000.0d / i) * 1.6d * 3.6d).setScale(2, 4).doubleValue();
        } else {
            this.wheel = Utils.DOUBLE_EPSILON;
        }
    }

    public int getPower() {
        return this.power;
    }

    public void setPower(int i) {
        this.power = i;
    }

    public int getDuration() {
        return this.duration;
    }

    public void setDuration(int i) {
        this.duration = i;
    }

    public double getDistance() {
        return this.distance;
    }

    public void setDistance(int i) {
        this.distance = i * 1.6d;
    }
}
